package com.small.common.util.jwt.info.impl;

import com.small.common.util.jwt.info.IJwtInfo;

import java.io.Serializable;

/**
 * 作者: fenny
 * 邮箱: 893146555@qq.com
 * 时间: 2017/10/20 23:47
 * 描述: jwt基本信息实体
 */
public class JwtInfoImpl implements Serializable, IJwtInfo {

    private static final long serialVersionUID = 1L;

    private int isSystem;

    private long id;

    private String account;

    private String name;

    private String roles;

    private String data;

    private String token;

    public JwtInfoImpl() {
    }

    /**
     * @param account 账号
     */
    public JwtInfoImpl(String account) {
        this.account = account;
    }

    /**
     * @param isSystem 1系统管理员0不是
     * @param id       管理员ID
     * @param account  账号
     * @param name     用户名称
     * @param roles    角色:1,2,3,4
     */
    public JwtInfoImpl(int isSystem, long id, String account, String name, String roles) {
        this.isSystem = isSystem;
        this.id = id;
        this.account = account;
        this.name = name;
        this.roles = roles;
    }

    @Override
    public int getIsSystem() {
        return isSystem;
    }

    public void setIsSystem(int isSystem) {
        this.isSystem = isSystem;
    }

    @Override
    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    @Override
    public String getAccount() {
        return account;
    }

    @Override
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    @Override
    public String getRoles() {
        return roles;
    }

    @Override
    public String getData() {
        return data;
    }

    @Override
    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public void setData(String data) {
        this.data = data;
    }

    public void setRoles(String roles) {
        this.roles = roles;
    }

    /*
    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        JwtInfoImpl jwtInfo = (JwtInfoImpl) o;
        return isSystem == jwtInfo.getIsSystem()
                && adminId == jwtInfo.getAdminId()
                && (account != null ? account.equals(jwtInfo.getAccount()) : jwtInfo.account == null)
                && (name != null ? name.equals(jwtInfo.getName()) : jwtInfo.name == null)
                && (roles != null ? roles.equals(jwtInfo.getRoles()) : jwtInfo.roles == null);
    }
    */

}
